package com.example.product.presentation;

import android.util.Log;


import com.example.presentation_libary.eventBus.MsgEvent;
import com.example.presentation_libary.interfaces.ScreenAddViewInterFace;
import com.example.presentation_libary.presentation.MultiScreenPresentation;
import com.example.product.Constants;
import com.example.product.presentationViews.DislayBannerView;
import com.example.product.presentationViews.DislayVideoView;

/**
 * @author: tjf
 * @date: 2022-10-20
 * @desc： 处理添加各种副屏的view
 */
public class PresentionAddViewUtils implements ScreenAddViewInterFace {
    @Override
    public void onAddViewAndMsgEventBus(MsgEvent mapEvent, MultiScreenPresentation presentation) {
        Log.i("==添加的辅屏View数据==", mapEvent.toString());

        //视频广告
        if (Constants.PagePresentation.PRESENTATION_VIDEO.equalsIgnoreCase(mapEvent.getType())) {
            DislayVideoView auxiliaryVideoView = new DislayVideoView(presentation.mContext, mapEvent.getJson());
            presentation.setAddView(auxiliaryVideoView);
        }
        //商品广告
        if (Constants.PagePresentation.PRESENTATION_PRODUCT_ADV.equalsIgnoreCase(mapEvent.getType())) {
            DislayBannerView auxiliaryVideoView = new DislayBannerView(presentation.mContext, mapEvent.getJson());
            presentation.setAddView(auxiliaryVideoView);
        }
    }
}
